#include<stdio.h>
int main()
{
    unsigned long long n,cnt=0;
    scanf("%llu",&n);
    while(n/10!=0)
    {
        int sum=0;
        while(n!=0)
        {
            sum=sum+n%10;
            n/=10;
        }
        n=sum;
        cnt++;
    }
    printf("%llu",cnt);
}